﻿#include "concretestatea.h"

#include <QtGlobal>
#include <QDebug>

#include "concretestateb.h"
#include "context.h"

State* ConcreteStateA::m_pSelf = Q_NULLPTR;

ConcreteStateA::ConcreteStateA()
{

}

State *ConcreteStateA::getInstance()
{
    if (m_pSelf == Q_NULLPTR)
        m_pSelf = new ConcreteStateA();
    return m_pSelf;
}

void ConcreteStateA::handle(Context* context)
{
    qDebug() << "handle in ConcreteStateA";
    context->changeState(ConcreteStateB::getInstance());
}

